<%-- 
    Document   : index
    Created on : 28-set-2010, 14.57.49
    Author     : giosk
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>EverythingOnline Store</title>
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <base target="_self"/>
    </head>
    <body>
        <%@include file="WEB-INF/jspf/header.jspf"%>

        <!-- start page -->
        <div id="content">

            <c:choose>
                <c:when test="${!empty sessionScope.username}">
                    <div class="post" style="background: url(images/user.png) no-repeat top right">
                        <h2 class="title">Bentornato/a ${sessionScope.username}!</h2>
                        <div class="entry">
                            <p>Il tuo credito attuale è di <strong>${sessionScope.credito}0 €</strong>.</p>
                        </div>
                    </div>
                </c:when>

                <c:otherwise>
                    <div class="post" style="background: url(images/home.png) no-repeat top right">
                        <h2 class="title">Benvenuto!</h2>
                        <div class="entry">
                            <c:if test="${requestScope.msg != null}">
                                <div class="msg">
                                    ${msg}
                                </div>
                            </c:if>
                            <c:if test="${requestScope.err != null}">
                                <div class="error">
                                    ${err}
                                </div>
                            </c:if>
                            <p>Inserisci i tuoi dati di accesso nel form sottostante:</p>
                            <div id="form_openID">
                                <form action="consumer_redirect_login.jsp" method="POST">
                                    <fieldset>
                                        <legend>openID</legend>
                                        <input type="text" name="openid" /><br />
                                        <input type="submit" value="Ok"/>
                                    </fieldset>
                                </form>
                            </div>
                            <form action="SessionHandler" method="post">
                                <table>
                                    <tr>
                                        <td><strong>Username:</strong></td>
                                        <td><input name="username" type="text"/></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Password:</strong></td>
                                        <td><input name="pwd" type="password"/></td>
                                    </tr>
                                    <tr>
                                    <input type="hidden" name="action" value="login" />
                                    <td><input type="submit" name="" value="login" /></td>
                                    </tr>
                                </table>
                            </form>                       

                            <h2>Non sei iscritto? <a href="registrazione.jsp" target="_self">Clicca qui!</a></h2>
                        </div>

                    </div>
                </c:otherwise>
            </c:choose>
        </div>

        <%@include file="WEB-INF/jspf/nav.jspf"%>
        <!-- end page -->

        <%@include file="WEB-INF/jspf/footer.jspf"%>
    </body>
</html>